//@author A0094701J

//This class consolidates all commonly utilized data extraction and comparing
//methods. It allows future versions to easily improve the functionality of 
//existing methods.

//The APIs that this class supports:
//1. void extractDigits(string checkParam, int &digit);
//2. void extractDigits(string checkParam, int &getFirst, int &getSecond);
//3. bool isDigit(string checkParam);
//4. vector<string> splitParameters(string parameters);
//5. bool equalsIgnoreCase(const string& str1, const string& str2);

//Acknowledgements:
//1. Dave Jun and Loke Yan Hao for splitParameters and equalsIgnoreCase functions
//taken from the CityConnect tutorial in CS2103.

#ifndef UTILITY_H_
#define UTILITY_H_

#include <qstring.h>
#include <vector>
#include <ctype.h>
#include <string>
#include <sstream>
#include <algorithm>
#include <stdlib.h>
#include <assert.h>
#include "InvalidInputException.h"

using namespace std;

class Utility {
public:
	//Digit parsing functions
	void extractDigits(QString checkParam, int &digit);
	void extractDigits(QString checkParam, int &getFirst, int &getSecond);
	bool isDigit(QString checkParam);

	//String splitting function
	vector<string> splitParameters(string parameters);

	//Case insensitive string comparator function
	bool equalsIgnoreCase(const QString& str1, const QString& str2);

	QString removeWhiteSpace(QString param);

};

#endif